﻿using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections.Generic;
using System;

namespace GeekShop
{
    public class Mask
    {
        #region Fields
        private Bitmap bumpmap;
        private Region region;
        private Point location;
        private bool visible;
        #endregion

        #region Properties
        public Bitmap Bumpmap
        {
            get { return bumpmap; }
            set { bumpmap = value; }
        }
        public Point Location
        {
            get { return location; }
            set { location = value; }
        }
        public bool Visible
        {
            get { return visible; }
            set { visible = value; }
        }
        #endregion

        #region Virtual Properties
        public Size Size
        {
            get { return this.bumpmap.Size; }
        }
        public Region Region
        {
            get
            {
                return this.region != null 
                        ? this.region
                        : new Region(new Rectangle(0, 0, this.Size.Width, this.Size.Height));
            }
            set { this.region = value; }
        }
        public Rectangle Rectangle
        {
            get { return new Rectangle(this.location, this.bumpmap.Size); }
        }
        #endregion

        #region Constructors
        public Mask(Size size) : this(new Bitmap(size.Width, size.Height))
        {}
        public Mask(Bitmap bumpmap)
        {
            this.bumpmap = bumpmap;
        }
        #endregion
    }
}
